home *** CD-ROM | disk | FTP | other *** search
/ CD ROM Paradise Collection 4 / CD ROM Paradise Collection 4 1995 Nov.iso / program / swagd_f.zip / EGAVGA.SWG / 0114_Set Border Colors.pas < prev    next >
Pascal/Delphi Source File  |  1994-08-24  |  1KB  |  38 lines

  1.  
  2. program Demo_4_SWAG;
  3. var
  4.   old_border : integer; { used in main body of program }
  5.   Rnd_border : integer;
  6.  
  7. (****************************************************************************)
  8. procedure Set_Border(color:byte); { Written by Pat Roberts 1994 }
  9. begin
  10.  asm
  11.   mov ah,10h     { This subroutine sets the color value stored in the }
  12.   mov al,01h     { overscan register of the current palette from the }
  13.   mov BH,Color   { Bios thru int 10h . Assumes EGA\VGA }
  14.   int 10h
  15.  end;
  16. end;
  17.  
  18. (****************************************************************************)
  19. function Get_Border:byte; { Written by Pat Roberts 1994 }
  20. begin
  21.  asm
  22.   mov ah,10h      { This subroutine reads the color value stored in the }
  23.   mov al,08h      { overscan register of the current palette from the }
  24.   int 10h         { Bios thru int 10h. Assumes EGA\VGA }
  25.   mov @result,bH  { result is byte(BL) not a integer(BX) }
  26.  end;
  27. end;
  28.  
  29. (******************************Main******************************************)
  30. begin
  31.  Randomize;
  32.  old_border := get_border;
  33.  writeln(' Old border color was ',old_border);
  34.  Rnd_border := ((random(7)+1));
  35.  set_border(rnd_border);
  36.  writeln(' Get_Border reports color ',get_border); readln; end.
  37. end.
  38.